#include <bits/stdc++.h>
// 2025/03/21
// tag: 
// Author: Forever
using namespace std;
using int64 = int64_t;

int n, nums[200001];

signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    //freopen("test.txt", "w", stdout);
    int t;
    cin >> t;
    while (t--)
    {
        cin >> n;
        for (int i = 1; i <= n; i++)
            cin >> nums[i];
        bool flag = true;
        for (int i = 1; i <= n; i++)
        {
            if (abs(nums[i] - i) > 1)
            {
                flag = false;
                break;
            }
        }
        if (flag)
            cout << "YES" << endl;
        else
            cout << "NO" << endl;

    }
    return 0;
}